/*
 *  Copyright 2020-2025 the original author or authors.
 *  You cannot use this file unless authorized by the author.
 */

package org.ipig.model;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.ToString;
import org.ipig.constants.DataCnst;
import org.ipig.constants.DbmsOperators;
import org.ipig.constants.FieldCnst;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * JoinParamConf
 *
 * @author <a href="mailto:comchnts@163.com">chinats</a>
 * @version $$Id$$
 * @since 1.0
 */
@Data
@ToString
public class JoinParamConf implements Serializable {
    //业务编码
    private String biz;
    //业务维度,匹配字段【多个字段使用逗号隔开】，注多个字段之间是或关系
    private String dim = FieldCnst.CODE;
    //具体key
//    private String key;
    //查询语句中的参数字段【只支持单个参数】
    private String paramField;
    //匹配模式
    private String match = DataCnst.MatchPattern.FULL.code;
    //字段，多个以逗号隔开
//    private String fields;
    //获取的字段多个用逗号分隔
    private String fetchFields;
    //【对外暴露】值映射字段，多个以逗号隔开【与fetchFields一一对应映射】，有序
    private String mapingFields;
    //数量
    private int top = 100;
    //调用方代码
    private String from;
    //连接器Conf
    @JSONField(serialize = false, deserialize = false)
    private ConnectorConf connectorConf;
    private String connectorCode;
    //连接类型：支持inner(内连接）【默认】-用于业务关联、rigth(右连接）-用于业务关联、left(左连接)-用于参数关联
    private String joinType = DbmsOperators.JoinType.INNER.code;
    //cache开关：true为开启，其它为关闭，默认为关闭
    private Boolean cacheEnable = Boolean.valueOf(false);
    //调试标识 默认关闭
    private Boolean debugEnable = Boolean.valueOf(false);
    // 其它属性
    private Map<String, String> props = new HashMap<String, String>();
}